package progress.exa28_1.part3;

/**
 * 通过继承Thread来新建任务类，这时任务类和线程类是一体的
 */
public class TaskThreadDemo extends Thread {

    private final char charToPrint;

    private final int times;

    public TaskThreadDemo(char charToPrint, int times) {
        this.charToPrint = charToPrint;
        this.times = times;
    }

    public void run(){
        for(int i=0;i<times;i++) {
            System.out.print(charToPrint);
        }
    }


}
